package com.voe.callback;

public abstract class Encryption {

	// Encrypt the given data.
	//
	// Args:
	// channel: The channel to encrypt data for.
	// in_data: The data to encrypt. This data is bytes_in bytes long.
	// out_data: The buffer to write the encrypted data to. You may write more
	// bytes of encrypted data than what you got as input, up to a maximum
	// of webrtc::kViEMaxMtu if you are encrypting in the video engine, or
	// webrtc::kVoiceEngineMaxIpPacketSizeBytes for the voice engine.
	// bytes_in: The number of bytes in the input buffer.
	// bytes_out: The number of bytes written in out_data.
	protected abstract byte[] encrypt(int channel, byte[] in_data);

	// Decrypts the given data. This should reverse the effects of encrypt().
	//
	// Args:
	// channel_no: The channel to decrypt data for.
	// in_data: The data to decrypt. This data is bytes_in bytes long.
	// out_data: The buffer to write the decrypted data to. You may write more
	// bytes of decrypted data than what you got as input, up to a maximum
	// of webrtc::kViEMaxMtu if you are encrypting in the video engine, or
	// webrtc::kVoiceEngineMaxIpPacketSizeBytes for the voice engine.
	// bytes_in: The number of bytes in the input buffer.
	// bytes_out: The number of bytes written in out_data.
	protected abstract byte[] decrypt(int channel, byte[] in_data);

	// Encrypts a RTCP packet. Otherwise, this method has the same contract as
	// encrypt().
	protected abstract byte[] encrypt_rtcp(int channel, byte[] in_data);

	// Decrypts a RTCP packet. Otherwise, this method has the same contract as
	// decrypt().
	protected abstract byte[] decrypt_rtcp(int channel, byte[] in_data);
}
